package com.hoopchina.weibo.ui;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;

/**
 * 
 * @author neusoft
 * 
 */
public class BindingDBHelper extends SQLiteOpenHelper {
	private static final int DATABASE_VERSION = 1;

	public BindingDBHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
	}

	public BindingDBHelper(Context context, String name) {
		this(context, name, DATABASE_VERSION);
	}

	public BindingDBHelper(Context context, String name, int version) {
		this(context, name, null, version);

	}

	@Override
	public synchronized void close() {
		super.close();
	}

	@Override
	public synchronized SQLiteDatabase getReadableDatabase() {
		return super.getReadableDatabase();
	}

	@Override
	public synchronized SQLiteDatabase getWritableDatabase() {
		return super.getWritableDatabase();
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("create table if not exists my_binding_table( fromsite VARCHAR primary key,screenname VARCHAR , type INTEGER,  headurl CHAR, token VARCHAR,tokensecret VARCHAR);");
	}

	@Override
	public void onOpen(SQLiteDatabase db) {
		super.onOpen(db);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	}
}
